package cn.iocoder.yudao.module.crossborder.platform.dal.mysql.platformproductmapping;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.crossborder.platform.dal.dataobject.platformproductmapping.PlatformProductMappingDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.crossborder.platform.controller.admin.platformproductmapping.vo.*;

/**
 * 跨境电商平台产品映射 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PlatformProductMappingMapper extends BaseMapperX<PlatformProductMappingDO> {

    default PageResult<PlatformProductMappingDO> selectPage(PlatformProductMappingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PlatformProductMappingDO>()
                .eqIfPresent(PlatformProductMappingDO::getPlatformId, reqVO.getPlatformId())
                .eqIfPresent(PlatformProductMappingDO::getStoreId, reqVO.getStoreId())
                .eqIfPresent(PlatformProductMappingDO::getLocalProductId, reqVO.getLocalProductId())
                .eqIfPresent(PlatformProductMappingDO::getLocalSku, reqVO.getLocalSku())
                .eqIfPresent(PlatformProductMappingDO::getPlatformProductId, reqVO.getPlatformProductId())
                .eqIfPresent(PlatformProductMappingDO::getPlatformSku, reqVO.getPlatformSku())
                .eqIfPresent(PlatformProductMappingDO::getPlatformListingId, reqVO.getPlatformListingId())
                .eqIfPresent(PlatformProductMappingDO::getPlatformAsin, reqVO.getPlatformAsin())
                .eqIfPresent(PlatformProductMappingDO::getPlatformItemId, reqVO.getPlatformItemId())
                .eqIfPresent(PlatformProductMappingDO::getPlatformVariantId, reqVO.getPlatformVariantId())
                .eqIfPresent(PlatformProductMappingDO::getMappingStatus, reqVO.getMappingStatus())
                .eqIfPresent(PlatformProductMappingDO::getSyncStatus, reqVO.getSyncStatus())
                .betweenIfPresent(PlatformProductMappingDO::getLastSyncTime, reqVO.getLastSyncTime())
                .eqIfPresent(PlatformProductMappingDO::getSyncErrorMsg, reqVO.getSyncErrorMsg())
                .eqIfPresent(PlatformProductMappingDO::getPlatformUrl, reqVO.getPlatformUrl())
                .eqIfPresent(PlatformProductMappingDO::getPlatformStatus, reqVO.getPlatformStatus())
                .eqIfPresent(PlatformProductMappingDO::getPlatformPrice, reqVO.getPlatformPrice())
                .eqIfPresent(PlatformProductMappingDO::getPlatformCurrency, reqVO.getPlatformCurrency())
                .eqIfPresent(PlatformProductMappingDO::getPlatformInventory, reqVO.getPlatformInventory())
                .eqIfPresent(PlatformProductMappingDO::getAutoSync, reqVO.getAutoSync())
                .betweenIfPresent(PlatformProductMappingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PlatformProductMappingDO::getId));
    }

}